(define (gcd a b)
        (if (= b 0)
            a
            (gcd b (remainder a b))))

(display (gcd 206 40))
(newline) 

; 应用序
(gcd 206 40)
(gcd 40 (remainder 206 40))
(gcd 6 (remainder 40 6))
(gcd 4 (remainder 6 4))
(gcd 2 (remainder 4 2))
(gcd 2 0) = 2

; 正则序
(if (= 40 0)
    206
    (gcd 40 (remainder 206 40))) ; t1 = (remainder 206 40) = 6
    (if (= t1 0) ; #f
        40
        (gcd t1 (remainder 40 t1))) ; t2 = (remainder 40 t1) = 4
        (if (= t2 0) ; #f
            t1
            (gcd t2 (remainder t1 t2))) ; t3 = (remainder t1 t2) = 2
            (if (= t3 0)
                t2
                (gcd t3 (remainder t2 t3))) ; t4 = (remainder t2 t3) = 0
                (if (= t4 0) ; #t
                    t3 ;-----------------------------------------------
                    (gcd ...))
t3 = (remainder t1 t2)
   = (remainder t1 (remainder 40 t1))
   = (remainder (remainder 206 40) (remainder 40 (remainder 206 40)))
   = (remainder 6 (remainder 40 6))
   = (remainder 6 4)
   = 2                    
   
(if (= 40 0)
   206
   (gcd 40 (remainder 206 40)))
   (if (= (remainder 206 40) 0) ; #f
       40
   (gcd (remainder 206 40) (remainder 40 (remainder 206 40))))
       (if (= (remainder 40 (remainder 206 40)) 0) ; #f
           (remainder 206 40)
           (gcd (remainder 40 (remainder 206 40)) (remainder (remainder 206 40) (remainder 40 (remainder 206 40)))))
           (if (= (remainder (remainder 206 40) (remainder 40 (remainder 206 40))) 0) ; #f
               (remainder 40 (remainder 206 40))
           (gcd (remainder (remainder 206 40) (remainder 40 (remainder 206 40))) (remainder (remainder 40 (remainder 206 40)) (remainder (remainder 206 40) (remainder 40 (remainder 206 40))))))
               (if (= (remainder (remainder 40 (remainder 206 40)) (remainder (remainder 206 40) (remainder 40 (remainder 206 40)))) 0) ; #t
                   (remainder (remainder 206 40) (remainder 40 (remainder 206 40)))
                (remainder (remainder 206 40) (remainder 40 6))
            (remainder (remainder 206 40) 4)
        (remainder 6 4)
    2